﻿@{
    ViewBag.Title = "Form";
    Layout = "~/Views/Shared/_Form.cshtml";
}
<style>

    /* 图片上传 */
    .uploader-list {
        margin-left: -15px;
    }

        .uploader-list .info {
            position: relative;
            margin-top: -25px;
            background-color: black;
            color: white;
            filter: alpha(Opacity=80);
            -moz-opacity: 0.5;
            opacity: 0.5;
            width: 100px;
            height: 25px;
            text-align: center;
            display: none;
        }

        .uploader-list .handle {
            position: relative;
            background-color: black;
            color: white;
            filter: alpha(Opacity=80);
            -moz-opacity: 0.5;
            opacity: 0.5;
            width: 100px;
            text-align: right;
            height: 18px;
            margin-bottom: -18px;
            display: none;
        }

            .uploader-list .handle i {
                margin-right: 5px;
            }

                .uploader-list .handle i:hover {
                    cursor: pointer;
                }

        .uploader-list .file-iteme {
            margin: 12px 0 0 15px;
            padding: 1px;
            float: left;
        }
</style>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div id="frmPreview"></div>
    </div>
</div>
<script>
    //只读参数
    var readonly = true;
    layui.use(['jquery', 'form', 'common', 'formPreview'], function () {
        var form = layui.form,
            common = layui.common,
            $ = layui.jquery,
            formPreview = layui.formPreview;
        var keyValue = $.request("keyValue");
        $(function () {
            common.ajax({
                url: '/SystemManage/Form/GetFormJson',
                dataType: 'json',
                data: { keyValue: keyValue },
                async: false,
                success: function (data) {
                    if (data.F_FrmType != 0) {
                        $("#frmPreview").load(document.location.origin + '/form/' + data.F_WebId + '.html');
                    }
                    else {
                        //表单设计器
                        formPreview.render({
                            data: JSON.parse(data.F_Content),
                            elem: '#frmPreview'
                        });

                    }
                }
            });
            form.render();
        });
        wcLoading.close();
    })
</script>
